ActionController::Routing::Routes.draw do |map|
  # The priority is based upon order of creation: first created -> highest priority.

  # Sample of regular route:
  #   map.connect 'products/:id', :controller => 'catalog', :action => 'view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   map.resources :products

  # Sample resource route with options:
  #   map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }

  # Sample resource route with sub-resources:
  #   map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller

  # Sample resource route within a namespace:
  #   map.namespace :admin do |admin|
  #     # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
  #     admin.resources :products
  #   end

  # these non-restful routes are here for the sake of page caching
  map.connect 'logged_controllers/all/:sortby/:dir', :controller => 'logged_controllers', :action => 'index'
  %w(graphs graph_of_completion_times graph_of_db_times graph_of_hits graph_of_render_times).each do |act|
    map.connect "logged_controllers/:logged_controller_id/logged_actions/#{act}", 
      :controller => 'logged_actions', :action => act
  end
  map.connect 'logged_controllers/:id/:sortby/:dir', :controller => 'logged_controllers', :action => 'show'
  
  
	map.resources :logged_controllers, 
		:collection => { 	:graphs => :get, 
											:graph_of_hits => :get, 
											:graph_of_completion_times => :get, 
									  	:graph_of_render_times => :get, 
									  	:graph_of_db_times => :get  } do |logged_controllers|
		logged_controllers.resources :logged_actions, 
											:collection => { 	:graphs => :get, 
																				:graph_of_hits => :get, 
																				:graph_of_completion_times => :get, 
																				:graph_of_render_times => :get, 
																				:graph_of_db_times => :get }
	end
	
	map.resources :log_entries

  # root is logged_controllers/index
	map.root :controller => 'logged_controllers'
  
  # Install the default routes as the lowest priority.
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'
  
 
end
